package com.training.content.service.impl;

import java.util.List;
import com.training.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.training.content.mapper.ExamInfoMapper;
import com.training.content.domain.ExamInfo;
import com.training.content.service.IExamInfoService;

/**
 * 试卷信息Service业务层处理
 * 
 * @author training
 * @date 2021-10-25
 */
@Service
public class ExamInfoServiceImpl implements IExamInfoService 
{
    @Autowired
    private ExamInfoMapper examInfoMapper;

    /**
     * 查询试卷信息
     * 
     * @param examId 试卷信息主键
     * @return 试卷信息
     */
    @Override
    public ExamInfo selectExamInfoByExamId(Long examId)
    {
        return examInfoMapper.selectExamInfoByExamId(examId);
    }

    /**
     * 查询试卷信息列表
     * 
     * @param examInfo 试卷信息
     * @return 试卷信息
     */
    @Override
    public List<ExamInfo> selectExamInfoList(ExamInfo examInfo)
    {
        return examInfoMapper.selectExamInfoList(examInfo);
    }

    /**
     * 新增试卷信息
     * 
     * @param examInfo 试卷信息
     * @return 结果
     */
    @Override
    public int insertExamInfo(ExamInfo examInfo)
    {
        examInfo.setCreateTime(DateUtils.getNowDate());
        return examInfoMapper.insertExamInfo(examInfo);
    }

    /**
     * 修改试卷信息
     * 
     * @param examInfo 试卷信息
     * @return 结果
     */
    @Override
    public int updateExamInfo(ExamInfo examInfo)
    {
        examInfo.setUpdateTime(DateUtils.getNowDate());
        return examInfoMapper.updateExamInfo(examInfo);
    }

    /**
     * 批量删除试卷信息
     * 
     * @param examIds 需要删除的试卷信息主键
     * @return 结果
     */
    @Override
    public int deleteExamInfoByExamIds(Long[] examIds)
    {
        return examInfoMapper.deleteExamInfoByExamIds(examIds);
    }

    /**
     * 删除试卷信息信息
     * 
     * @param examId 试卷信息主键
     * @return 结果
     */
    @Override
    public int deleteExamInfoByExamId(Long examId)
    {
        return examInfoMapper.deleteExamInfoByExamId(examId);
    }
}
